<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>账号安全</title>
    <link rel="stylesheet" href="../../static/Semantic-UI-master/dist/semantic.min.css" th:href="@{/Semantic-UI-master/dist/semantic.min.css}">
    <link rel="stylesheet" href="../../static/css/custom.css" th:href="@{/css/custom.css}">
</head>
<body>
<!--此页面应有个人信息、头像、账户安全、我的课程-->
<nav class="ui attached segment m-padded-tb-mini">
    <div class="ui container">
        <div class="ui menu secondary font-size-middle font-y-center">

                <span class="ui teal header item">
                <img src="../../static/imges/1.png" th:src="@{/imges/1.png}" class="image-size-mini"/>
                </span>
            <a class="item" th:href="@{/}"><i class="home icon"></i>首页</a>
            <a class="item" th:href="@{/sy/syuser/syclass}"><i class="building icon"></i>sy课堂</a>
            <a class="item" href="aboutwe.html" th:href="@{/sy/syuser/aboutwe}"><i class="info icon"></i>关于我们</a>

            <div class="item right" th:if="${session.User}">
                <div class="ui simple dropdown">
                    <img class="ui avatar image dropdown" src="../static/imges/user.jpg" th:src="${session.User.userImg}">
                    <span th:text="${session.User.userName}"></span>
                    <div class="menu">
                        <a href="User/userPC.html" th:href="@{/sy/syuser/gopc}" class="item"><i class="user circle icon"></i>个人主页</a>
                        <a href="User/userPC.html" th:href="@{/sy/syuser/gopc}" class="item"><i class="edit outline icon"></i>管理中心</a>
                        <a href="/sy/syuser/logout" class="item"><i class="sign out alternate icon"></i>退出登录</a>
                    </div>
                </div>
            </div>


        </div>

    </div>
</nav>
<!--中间内容-->
<div class="ui container m-padded-tb-middle">

    <div class="ui grid">
        <!--  左侧导航栏  -->
        <div class="five wide column slide">
            <div class="ui link list segment" style="height: 400px">
                <div class="active item m-padded-tb-middle font-x-center">个人中心</div>
                <a class="item" href="userPC.html" th:href="@{/sy/syuser/gopc}"><button class="fluid ui button teal m-padded-tb-middle" id="xinxi">个人信息</button></a>
                <a class="item" href="myclass.html" th:href="@{/sy/xktable/showmyclass}"><button class="fluid ui button teal m-padded-tb-middle" id="kecheng">我的课程</button></a>
                <a class="item"><button class="fluid ui button teal active m-padded-tb-middle" id="anquan">账号安全</button></a>
            </div>
        </div>
        <!--   右侧内容 -->
        <div class="eleven wide column" id="pc_classp">
    <div class="ui segment font-x-center" style="height: 630px" id="pc_page">
        <div class="ui secondary pointing menu" id="father1">
            <!--       这里的active是被选中的意思     -->
            <a class="item active xuanzhong1" id="qiehuan1">账户安全 </a>
        </div>
        <div>
            <table class="ui very basic table">
                <tbody>
                <tr>
                    <td><i class="mobile icon"></i>手机</td>
                    <td id="phone" th:text="${session.User.userPhone}">218418228</td>
                    <td><a onClick="change_password('修改手机号','/sy/syuser/gouqphone','10001','600','270')" href="javascript:;" class="font-color-green">修改</a></td>
                </tr>
                <tr>
                    <td><i class="lock icon"></i>密码</td>
                    <td id="password" th:text="${session.User.userPwd}">388412518</td>
                    <td><a onClick="change_password('修改密码','/sy/syuser/gouqpassword','10001','600','270')" href="javascript:;" class="font-color-green">修改</a></td>
                </tr>

                </tbody>
            </table>
        </div>
    </div>
</div>

    </div>

</div>

<!--footer-->
<footer class="ui vertical segment b-color m-padded-tb-big">
    <div class="ui container">
        <div class="ui grid">
            <div class="eight wide column">
                <a class="item" href="aboutwe.html" th:href="@{/sy/syuser/aboutwe}">关于我们</a><br><br><br>
                <span class="ui teal header" style="display: inline;">
                        <img src="../../static/imges/1.png" th:src="@{/imges/1.png}"/></span>
                <span class="font-tmd">&nbsp;生命可以随心所欲，但不可以随波逐流。</span>
            </div>

            <div class="eight wide column font-tmd">
                计科172 梁瑜<br>
                2020/10/28
            </div>
        </div>
    </div>
</footer>
<input id="username" type="text" hidden th:value="${session.User.userName}">
<div th:if="${session.check}==1">
    <div th:text="<script type='text/javascript'>window.location.replace('/sy/syuser/SeCenter');</script>"></div>
</div>
</body>

<script src="../../static/js/jquery-3.5.1.min.js" th:src="@{/js/jquery-3.5.1.min.js}"></script>
<!--<script src="../../static/js/jquery-1.12.4.min.js" th:src="@{/js/jquery-1.12.4.min.js}"></script>-->
<script src="../../static/js/jquery-ui.min.js" th:src="@{/js/jquery-ui.min.js}"></script>
<script src="../../static/Semantic-UI-master/dist/semantic.min.js" th:src="@{/Semantic-UI-master/dist/semantic.min.js}"></script>
<script src="../../static/js/sy.min.js" th:src="@{/js/sy.min.js}"></script>
<script type="text/javascript" src="../../static/lib/layer/2.4/layer.js" th:src="@{/lib/layer/2.4/layer.js}"></script>
<script type="text/javascript" src="../../static/h-ui.admin/js/H-ui.admin.js" th:src="@{/h-ui.admin/js/H-ui.admin.js}"></script>
<script type="text/javascript">
    //开启小窗口
    function change_password(title,url,id,w,h){
        layer_show(title,url,w,h);
    }

    $(function () {
        var oldphone = $("#phone").text();
        var oldpassword = $("#password").text();
        var newphone = "";
        var newpassword = "";
        newphone = oldphone.replace(/^(\w{3})\w{4}(.*)$/, '$1****$2')
        for(i=0;i<oldpassword.length;i++){
            newpassword += "*";
        }
        $("#phone").text(newphone)
        $("#password").text(newpassword)
    })

    //替换手机号和密码的一些字符，不允许完全显示
    //需要在页面加载完之后执行
    // $(document).ready(function () {
    //     var oldphone = $("#phone").text();
    //     var oldpassword = $("#password").text();
    //
    //     var newphone = "";
    //     var newpassword = "";
    //     newphone = oldphone.replace(/^(\w{3})\w{4}(.*)$/, '$1****$2')
    //     for(i=0;i<oldpassword.length;i++){
    //         newpassword += "*";
    //     }
    //     $("#phone").text(newphone)
    //     $("#password").text(newpassword)
    // })




</script>
</html>